Repository navigation
mod_autht_jwt: Fix silent bypass of JWT exp/nbf claim enforcement (BZ 70275) - #952
Open
arturobernalg wants to merge 1 commit into
Open
arturobernalg wants to merge 1 commit into
arturobernalg wants to merge 1 commit into
Conversation
… 70275) check_token() only accepted the "exp" and "nbf" NumericDate claims when their JSON value decoded to APR_JSON_LONG. RFC 7519 NumericDate is "a JSON numeric value" and does not have to be an integer literal: a value written with a decimal point or exponent (e.g. 1700000000.0) decodes to APR_JSON_DOUBLE, and a quoted numeric string decodes to APR_JSON_STRING. Either way the claim was silently dropped, exp_set/nbf_set stayed 0, and the whole expiry/not-before check was skipped, so an expired or not-yet-valid token was granted. Accept APR_JSON_DOUBLE as a valid NumericDate (guarding against NaN/Inf and out-of-range values before the cast), and reject the token outright when "exp"/"nbf" is present with any other value type, instead of silently treating it as absent. PR: 70275
arturobernalg
force-pushed
the
fix/bz70275-jwt-exp-nbf-numericdate
branch
from
November 5, 2026 19:48
fb95d18 to
49a071e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
check_token() only accepted the "exp" and "nbf" NumericDate claims when their JSON value decoded to APR_JSON_LONG. RFC 7519 NumericDate is "a JSON numeric value" and does not have to be an integer literal: a value written with a decimal point or exponent (e.g. 1700000000.0) decodes to APR_JSON_DOUBLE, and a quoted numeric string decodes to APR_JSON_STRING. Either way the claim was silently dropped, exp_set/nbf_set stayed 0, and the whole expiry/not-before check was skipped, so an expired or not-yet-valid token was granted.
Accept APR_JSON_DOUBLE as a valid NumericDate (guarding against NaN/Inf and out-of-range values before the cast), and reject the token outright when "exp"/"nbf" is present with any other value type, instead of silently treating it as absent.
Reproduced live against a real httpd + apr-util 1.7 build: a validly-signed token with exp=1000000000.0 (float) or exp="1000000000" (string) was accepted (200) on unpatched code and correctly rejected (401) after the fix; a float nbf in the future was likewise accepted before the fix and rejected after. Confirmed the fix does not reject well-formed float NumericDate values that are still within their valid window.
PR: 70275